<?php
include_once './BaseService.php';
include_once '../model/db/ProdTypeDAO.php';
include_once '../model/util/Util.php';  

class CategoryService extends BaseService {
	
	public function __construct(){
		parent::__construct();
	 	parent::setTarget($this);	
//	 	$this->log = Plog::factory(__FILE__);	
	}
	
	public function getCategory(){
		$prodTypeDAO=new ProdTypeDAO();
		
	
		$result = $prodTypeDAO->queryAllWithSubType();
	
		if ($result[0]->{"pt_id"}== null) {
//			echo "{row:[]}";	
			echo "{}";
		} else {
//			echo "{row:".Util::toJson($result)."}";	
			echo Util::toJson($result);
		}
		
	}
}

$service =  new CategoryService();
$service->__call($_GET["action"], null);
//$service->queryTargetAccountMember();
?>